package com.yhy;

import java.net.InetSocketAddress;

/**
 * Listing 13.1 LogEvent message
 *
 * @author <a href="mailto:norman.maurer@gmail.com">Norman Maurer</a>
 */
public final class LogEvent {
    public static final byte SEPARATOR = (byte) ':';
    private final InetSocketAddress source;
    private final String logfile;
    private final String msg;
    private final long recvTime;


    public LogEvent(InetSocketAddress source, long recvTime,
                    String logfile, String msg) {
        this.source = source;
        this.logfile = logfile;
        this.msg = msg;
        this.recvTime = recvTime;
    }

    public InetSocketAddress getSource() {
        return source;
    }

    public String getLogfile() {
        return logfile;
    }

    public String getMsg() {
        return msg;
    }

    public long getReceivedTimestamp() {
        return recvTime;
    }
}
